package com.ruoyi.toobit.task;

import com.ruoyi.swap.openapi.currencyPair.controller.SwapcurrencyPair;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

/**
 * 合约交易对同步任务封装（位于 com.ruoyi.toobit.task 白名单包下）
 * 调用目标：swapCurrencyPairSyncTask.execute()
 */
@Component("swapCurrencyPairSyncTask")
public class SwapCurrencyPairSyncTask {

    private static final Logger log = LoggerFactory.getLogger(SwapCurrencyPairSyncTask.class);

    @Autowired
    private SwapcurrencyPair swapcurrencyPair;

    public void execute() {
        try {
            log.info("[SwapCurrencyPairSyncTask] 开始同步合约交易对...");
            swapcurrencyPair.compareSwapCurrenyPairs();
            log.info("[SwapCurrencyPairSyncTask] 同步合约交易对完成");
        } catch (Exception e) {
            log.error("[SwapCurrencyPairSyncTask] 执行异常", e);
        }
    }
}


